package com.dwms.feign.system;

import com.dwms.entity.Request;
import com.dwms.entity.Result;
import com.dwms.entity.system.login.request.LoginRequest;
import com.dwms.entity.system.login.response.VerifyCodeResponse;
import com.dwms.entity.system.menu.response.RouterResponse;
import com.dwms.entity.system.user.response.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "system-server",path = "/login")
public interface LoginFeignClient {

    /**
     * 获取验证码
     * @return
     */
    @PostMapping("/getVerifyCode")
    Result<VerifyCodeResponse> getVerifyCode();

    /**
     * 用户登录
     * @param loginRequest
     * @return
     */
    @PostMapping("/submit")
    Result submit(@RequestBody LoginRequest loginRequest);

    /**
     * 查询用户信息
     * @return
     */
    @PostMapping("/getUserInfo")
    Result<UserInfo> getUserInfo(@RequestBody Request request);

    /**
     * 获取路由信息
     * @return
     */
    @PostMapping("/findRouters")
    Result<List<RouterResponse>> findRouters(@RequestBody Request request);

    /**
     * 登录注销
     * @return
     */
    @PostMapping("/logout")
    Result logout(@RequestBody Request request);
}
